
'''
Created on 22.6.2012

@author: mphkh
'''
from CashFlowUtils.IceBonds import *
from Calendar.Iceland import *
from datetime import date
from datetime import timedelta

tradedate = date(2013,1,13)

bond1 = ISLACBI16()
yld1 = 0.0213

bond2 = ISLACBI19()
yld2 = 0.0256

bond3 = ISLACBI24()
yld3 = 0.0293

'''
bond4 = ARIONCBI34()
yld4 = 0.0314
'''

bond4 = HFF150914()
yld4 = 0.0077

bond5 = HFF150224()
yld5 = 0.0176

bond6 = LAND051()
yld6 = 0.0198

bond7 = MPABS1()
yld7 = 0.035

bond8 = MPABS2()
bond9 = MPABS3()


print bond1.duration(tradedate,yld1)
print bond2.duration(tradedate,yld2)
print bond3.duration(tradedate,yld3)
print bond4.duration(tradedate,yld4)
print bond5.duration(tradedate,yld5)
print bond6.duration(tradedate,yld6)
print bond7.duration(tradedate,0.030)
print bond8.duration(tradedate,0.030)
print bond9.duration(tradedate,0.030)

cf = bond8.cashflows()

for obj in cf:
    print obj.yearfrac, obj.cfdate, obj.daysPeriod, obj.amount, obj.notional, obj.interests, obj.amortization

print '-------------------------------------'



'''
yld = bond.yld(tradedate, 97.2)

dprice = bond.dirtyprice(tradedate, yld)
'''


